package com.springcloud;

import com.springcloud.service.MyService;
import feign.Feign;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;

/**
 * EnableCircuitBreaker 断路器
 * @author: 顾志杰
 */
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@EnableCircuitBreaker
public class HystrisFallbackApplication {

    public static void main(String[] args) throws NoSuchMethodException {
        /*Feign获取方法签名*/
        System.out.println(Feign.configKey(MyService.class,MyService.class.getMethod("retry", int.class)));

        new SpringApplicationBuilder(HystrisFallbackApplication.class)
                .web(WebApplicationType.SERVLET)
                .run(args);
    }
}
